function dF = ffunQuant(V,F,mu, r, gamma ,Lambda, phi,q,vX,vA, vC,delta,VB,face,tauB,vW,vSol)
        %Calculate Model Quantities by solving ODE
        %This function returns the derivatives with respect to V
        
        %F(3)=tau %Expected Time to Default
        %F(2)=beta %Retained Share
        %F(1)=L %Loan Price
        
        dF=zeros(3,1);
        
        D=F(1);
        beta=F(2);
        tau=F(3);
        
        [m,ind]=min(abs(vX-V));
        c=vC(ind);
        c=c+delta*(vW(ind)-beta*vSol(ind));
        a=vA(ind);
        W=phi*a;
        lambda=Lambda-a-q;
        dV=min(-0.0000001,(gamma+lambda+delta)*V-W);
        
        dbetaM=(mu*beta-c)/dV/D;
        dD=((r+lambda)*D-mu)/dV;
        dtau=((lambda)*tau-1)/dV;
        
        dF=[dD;dbetaM;dtau];
        
        


end